Current Location: Home> Function Categories> round

round

Round floating point numbers
Name:round
Category:math
Programming Language:php
One-line Description:Round the floating point number.

Definition and usage

round() function rounds up floating point numbers.

Example

 <?php
echo ( round ( 0.60 ) ) ;
echo ( round ( 0.50 ) ) ;
echo ( round ( 0.49 ) ) ;
echo ( round ( - 4.40 ) ) ;
echo ( round ( - 4.60 ) ) ;
?>

Try it yourself

grammar

 round ( x , prec )
parameter describe
x Optional. Specify the number to be rounded.
prec Optional. Specify the number of digits after the decimal point.

illustrate

Returns the result of rounding x according to the specified precision prec (the number of numbers after decimal decimal points). prec can also be a negative number or zero (default value).

Similar Functions
  • Logarithm with base 10 log10

    log10

    Logarithmwithbase10
  • Convert octal to decimal octdec

    octdec

    Convertoctaltodecima
  • Antihyperbolic tangent atanh

    atanh

    Antihyperbolictangen
  • Antihyperbolic cosine acosh

    acosh

    Antihyperboliccosine
  • Find the minimum value min

    min

    Findtheminimumvalue
  • Determine whether it is a legal value is_nan

    is_nan

    Determinewhetheritis
  • Convert angle to radians deg2rad

    deg2rad

    Convertangletoradian
  • Calculate the index of e exp

    exp

    Calculatetheindexofe
Popular Articles